with open('get.txt') as f:
    lines = f.readlines()

for i in range(len(lines)):
    row = lines[i].strip().split()
    num = int(row[0])
    col2 = row[1]
    col3 = row[2]
    results = []
    newdata=0
    count=0
    while num != 0:
        if(count==0):
            newdata= newdata+(num % 10)
        if (count == 1):
            newdata = newdata + (num % 10) * 4
        if (count == 2):
            newdata = newdata + (num % 10) * 24
        if (count == 3):
            newdata = newdata + (num % 10) * 144
        if (count == 4):
            newdata = newdata + (num % 10) * 720
        if (count == 5):
            newdata = newdata + (num % 10) * 2880
        count=count+1
        num=num/10
    newdata=int(newdata)
    results.append(newdata)
    lines[i] = str(newdata) + '\t' + col2 + '\t' + col3 + '\n'

with open('output.txt', 'w') as f:
    f.writelines(lines)